function RK=Puntoc(a,b,ya,M,f1,f2)
% Ejemplo de invocaci??n
% Puntoc(0,48,10,48,"f1","f2");

% Parametros de Runge kutta-4
h=(b-a)/M;
T=zeros(1,M+1);
Y1=zeros(1,M+1);
Y2=zeros(1,M+1);
T=a:h:b;
Y1(1)=ya;
Y2(1)=ya;

% modelo de simulaci??n
kArr=[0.25,0.5,1,2,5,10,15,20];
global ku;
global k;
global TOUT_M;
global TD;

TD=20;
TOUT_M=10;
k=kArr(1);
ku=0.7;

for j=1:M   
	K1=feval(f1,T(j),Y1(j));
	K2=feval(f1,T(j)+(h/2),Y1(j)+(K1/2));
	K3=feval(f1,T(j)+(h/2),Y1(j)+(K2/2));
	K4=feval(f1,T(j)+h,Y1(j)+K3);

	Y1(j+1)=Y1(j)+(1/6)*(K1+2*K2+2*K3+K4)*h;
end

for j=1:M   
	K1=feval(f2,T(j),Y2(j));
	K2=feval(f2,T(j)+(h/2),Y2(j)+(K1/2));
	K3=feval(f2,T(j)+(h/2),Y2(j)+(K2/2));
	K4=feval(f2,T(j)+h,Y2(j)+K3);

	Y2(j+1)=Y2(j)+(1/6)*(K1+2*K2+2*K3+K4)*h;
end

RK=[T' Y1'];

RK2=[T' Y2'];

%plot(RK(:,1),RK(:,2));
%plot(RK2(:,1),RK2(:,2));
plot(RK(:,1),RK(:,2),'--',RK2(:,1),RK2(:,2),'-',RK(:,1),Tout(RK(:,1)),'*');
hleg=legend('mod1', 'mod2', 'Tout', 'Location','NorthEastOutside');

global IMG_PATH;
print(strcat(IMG_PATH,"Punto1c.png"));
replot;

end


